﻿using System;
using System.Windows.Forms;
using CodeCrawler.UI.Functionalities.Reporting;

namespace CodeCrawler.UI.Forms.ChildForms {
    public partial class GenerateReport : Form {
        public GenerateReport() {
            InitializeComponent();
        }


        public string dumpLocation { get; set; }
        private string reportFileLocation { get; set; }


        private void EnableButtons(object sender, EventArgs e) {
            int lenght = textBox1.Text.Length;
            if (lenght > 1) {
                button2.Enabled = true;
            }
            else {
                button2.Enabled = false;
            }

            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            reportFileLocation = Reporting.GenerateRTF(dumpLocation, textBox1.Text);
            System.Diagnostics.Process.Start(reportFileLocation);
            this.Close();
        }
    }
}